<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="${ctx}/css/common.css" />
<jsp:include page="../inc.jsp"></jsp:include>
<meta http-equiv="X-UA-Compatible" content="edge" />
<title>切位订单-更多详情</title>
<style>
		input{
			width:120px;
			height:18px;
			border:1px solid #77b2e0;
			border-radius: 3px;
		}
		select{
			height:20px;
			border:1px solid #77b2e0;
			border-radius: 3px;
		}
		.searchBox{
			width:1100px; 
			height:40px;
		}
		.searchBox li{
			float:left;
			margin-top:5px;
			margin-left:15px;
		}
		.tableOntab td{
			height:37px;
			border-right:none;
		}
		.tableOntab .borderNone{
			border-bottom:none;
		}
		.query{
			margin-left:5px;
		}
		/*使按钮居中*/
		.autoBoxTwo{
			width:180px;
			height:26px;
			margin:15px auto; 
		}
		input::-ms-clear{display:none;}
</style>

<script type="text/javascript">
	$(function(){
		var conStatus= ${param.conStatus};
		conStatus=CommonConverter.toContractStatusStr(conStatus);
		$("#conStatus").text(conStatus);//填充合同状态
		//加载表格信息
		dataGrid = $('#ticketTable').datagrid({
			url:'${ctx}/search/getBuyerList?conNo=${param.conNo}&temp='+Math.random(),
			//url:'${ctx}/json/ticketInfo.json',
			striped : true,
			singleSelect : true,
			idField : 'id',
			pageList : [5,10,20],
			//sortName : 'id',
			//sortOrder : 'asc',
			method : 'get',
			toolbar:'#toolbar',
			pagination:true,
			
			columns:[[
			          {
							width : '80',
							title : 'id',
							field : 'id',
							hidden : true,
						},{
							width : '180',
							title : '订单号',
							align:'center',
							field : 'orderNumber',
						},{
				width : '120',
				title : '航班号',
				align : 'center',
				field : 'airlineId',
				formatter : function(value,row){
					var table;
					if(row.list != null && row.list.length > 0){
						if(row.list.length == 1){
							table='<table class="tableOntab" style="width:120px;"><tr><td>'+((row.list))[0].airlineNumber+'</td></tr></table>';
						}else if(row.list.length == 2){
							table='<table class="tableOntab" style="width:120px;"><tr><td>'+((row.list))[0].airlineNumber+'</td>'+'</tr><tr>'+'<td class="borderNone">'+((row.list))[1].airlineNumber+'</td></tr></table>';
						}
					}
					return table;
				}
			},{
				width : '150',
				title : '出发',
				align : 'center',
				field : 'charterTypeStr',
				formatter : function(value,row){
					var table;
					if(row.list != null && row.list.length > 0){
						if(row.list.length == 1){
							table='<table class="tableOntab" style="width:150px;"><tr><td>'+(row.list)[0].deptCity+'('+(row.list)[0].deptCode+')</td></tr></table>';
						}else if(row.list.length == 2){
							table='<table class="tableOntab" style="width:150px;"><tr><td>'+(row.list)[0].deptCity+'('+(row.list)[0].deptCode+')'+'</td>'+'</tr><tr>'+'<td class="borderNone">'+(row.list)[1].deptCity+'('+(row.list)[1].deptCode+')'+'</td></tr></table>';
						}
					}
					return table;
				}
			},{
				width : '150',
				title : '到达',
				align : 'center',
				field : 'scheduleId',
				formatter : function(value,row){
					var table;
					if(row.list != null && row.list.length > 0){
						if(row.list.length == 1){
							table='<table class="tableOntab" style="width:150px;"><tr><td>'+(row.list)[0].arrCity+'('+(row.list)[0].arrCode+')</td></tr></table>';
						}else if(row.list.length == 2){
							table='<table class="tableOntab" style="width:150px;"><tr><td>'+(row.list)[0].arrCity+'('+(row.list)[0].arrCode+')'+'</td>'+'</tr><tr>'+'<td class="borderNone">'+(row.list)[1].arrCity+'('+(row.list)[1].arrCode+')'+'</td></tr></table>';
						}
					}
					return table;
				}
			},{
				width : '120',
				title : '出发日期',
				align : 'center',
				field : 'scheduleIdStr',
				formatter : function(value,row){
					var table;
					if(row.list != null && row.list.length > 0){
						if(row.list.length == 1){
							table='<table class="tableOntab" style="width:120px;"><tr><td>'+(row.list)[0].deptDate+'</td></tr></table>';
						}else if(row.list.length == 2){
							table='<table class="tableOntab" style="width:120px;"><tr><td>'+(row.list)[0].deptDate+'</td>'+'</tr><tr>'+'<td class="borderNone">'+(row.list)[1].deptDate+'</td></tr></table>';
						}
					}
					return table;
				}
			},{
				width : '120',
				title : '出发时刻',
				align:'center',
				field : 'journeyType',
				formatter : function(value,row){
					var table;
					if(row.list != null && row.list.length > 0){
						if(row.list.length == 1){
							table='<table class="tableOntab" style="width:120px;"><tr><td>'+CommonConverter.formatFlightTime((row.list)[0].deptTime)+'</td></tr></table>';
						}else if(row.list.length == 2){
							table='<table class="tableOntab" style="width:120px;"><tr><td>'+CommonConverter.formatFlightTime((row.list)[0].deptTime)+'</td>'+'</tr><tr>'+'<td class="borderNone">'+CommonConverter.formatFlightTime((row.list)[1].deptTime)+'</td></tr></table>';
						}
					}
					return table;
				}
			},{
				width : '100',
				title : '状态',
				align:'center',
				field : 'orderStatus',
				formatter:function(value,row){
					return CommonConverter.toOrderBizStatusStr(row.orderStatus);
				}
			},{
				width : '100',
				title : '单价(CNY)',
				align:'center',
				field : 'sellingPrice',
			},{
				width : '100',
				title : '数量',
				align:'center',
				field : 'purchQuantity',
			},{
				width : '100',
				title : '总价',
				align:'center',
				field : 'tot',
				formatter:function(value,row){
					return (row.sellingPrice)*(row.purchQuantity);
				}
			}
			] ]
		});
		
		
	});
	

</script>
</head>
<body style="padding-left:10px;padding-top:10px;">
	<div class="easyui-layout" data-options="fit:true,border:false" >
		 <div data-options="region:'north',border:false">
			<ul class="searchBox">
					<li>
						合同号：<span id="cashNo">${param.conNo}</span>
					</li>
					<li>
						合同状态：<span id="conStatus"></span>
					</li>
					<li>
						支付截止时间：<span id="payOverTime">${payOverTime}</span>
					</li>
					
				</ul>
			</div>
			 <div data-options="region:'center',border:false">
				<table id="ticketTable" data-options="fit:true"></table>
			</div>
		</div>
</body>
</html>